import java.util.*;

public class CountingSort 
{
	public static void main(String[] args)
	{
		int i;
		int[] A={2,5,3,0,2,3,0,3};
		int[] B = new int[8], C = new int[6];
		for(i=0; i < C.length; i++)
		{
			C[i] = 0;
		}
		for(i=0; i < A.length; i++)
		{
			C[A[i]] = C[A[i]] + 1;
		}
		
		for(i=1; i<C.length; i++)
		{
			C[i] = C[i] + C[i-1];
		}
		
		for(i=0; i<A.length; i++)
		{
			B[C[A[i]]-1] = A[i];
			C[A[i]] = C[A[i]] -1;
		}
		System.out.println(Arrays.toString(B));

	}
}
